Skip to content

th-d5b446: th code TUI conversation sidebar (resume + new)#182

Merged
brentrager merged 3 commits into
mainfrom
th-d5b446-tui-sidebar
Jul 9, 2026
Merged

th-d5b446: th code TUI conversation sidebar (resume + new)#182
brentrager merged 3 commits into
mainfrom
th-d5b446-tui-sidebar

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

The th code TUI had no way to browse or switch between saved coding sessions from within the UI — you had to quit and relaunch with th code --resume <query>. The daemon PWA already has a conversation sidebar; this brings the TUI to parity.

Solution

A togglable conversation sidebar built entirely on the TUI's existing local session store (crate::session::SessionManager) — no new persistence layer, no server round-trip.

  • Ctrl+B toggles a left-anchored overlay (same pattern as the model picker — inline-viewport mode has no persistent side pane; finalized chat lives in the terminal's own scrollback).
  • Lists saved sessions newest-first (title + relative time), the active session highlighted, with a "New conversation" entry pinned at the top.
  • Enter resumes the selected session (loads its history into the live AppState via the existing resume path) or starts a fresh one; n is a new-chat shortcut; Esc closes.
  • The current session is saved before switching so nothing is lost.

New module session_picker.rs (state + selection logic), AppState::resume_from / start_new_conversation (in-place session swap), a render overlay, and Ctrl+B wiring. Footer hint updated to Ctrl+B chats.

Verification

cargo fmt --check, cargo clippy, and cargo test -p smooai-smooth-code all green in an isolated target dir (257 tests pass, incl. 7 new: session ordering/selection + relative-time bucketing). No new clippy warnings attributable to this change.

🤖 Generated with Claude Code

Adds a togglable conversation sidebar to the `th code` TUI for parity
with the daemon PWA sidebar. Ctrl+B opens a left-anchored overlay
(same pattern as the model picker — inline-viewport mode has no
persistent pane) listing saved coding sessions newest-first with the
active session highlighted, plus a "New conversation" entry.

Built on the existing local session store (crate::session::
SessionManager) — Enter resumes the selected session by loading its
history into the live AppState via the existing resume path, or starts
a fresh conversation; `n` shortcuts new-chat; Esc closes. Current
session is saved before switching so nothing is lost.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d765c2b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

brentrager and others added 2 commits July 9, 2026 14:39
…th-bench

The CI runner bumped stable clippy to 1.97, whose clippy::all (deny)
now flags a redundant `&` on a format! argument in pr_harvest.rs that
1.96 accepted. Pre-existing code, unrelated to the sidebar, but it
fails the Clippy step for every PR against main. One-char fix: drop
the redundant borrow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two more pre-existing clippy::all (deny) lints newly raised by the CI
runner's stable clippy bump to 1.97:
- web_search.rs: question_mark — rewrite the quote-prefix if/else
  chain to strip_prefix().map().or_else()?
- model_picker.rs test: useless_borrows_in_formatting — drop redundant
  & in an assert! format arg.

Verified clean with `cargo +1.97 clippy --workspace --all-targets`.
Unrelated to the sidebar; unblocks CI for every PR against main.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brentrager brentrager merged commit 10e9625 into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant